package com.chrray.position.enums.app;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 当前登录身份: 雇工-0,雇主-1
 */
public enum FdUserRoleEnum implements BaseEnum{

    WORKER(0, "雇工"),
    BOSS(1, "雇主")
    ;

    @JsonValue
    @EnumValue
    private final Integer value;
    private final String info;

    FdUserRoleEnum(Integer value, String info) {
        this.info = info;
        this.value = value;
    }

    @JsonCreator
    public static FdUserRoleEnum getByValue(Integer value) {
        for (FdUserRoleEnum en : FdUserRoleEnum.values()) {
            if (en.getValue().equals(value)) {
                return en;
            }
        }
        return null;
    }

    public Integer getValue() {
        return value;
    }

    public String getInfo() {
        return info;
    }
}
